import Vue from 'vue';
import VueRouter from 'vue-router';
import { resolve } from 'path';
Vue.use(VueRouter)

export default new VueRouter({
	linkActiveClass:'link-active',
	routes :[
        {path:'/',redirect : '/manage/index/index'},
        {path:'/manage',redirect : '/manage/index/index'},
		{path:'/manage/index/index',component : resolve => require(['../pages/index/index.vue'],resolve)},
		{path:'/manage/index/needs',component : resolve => require(['../pages/index/needs.vue'],resolve),meta:{title:['首页','需求提交']}},
		{path:'/manage/user/list',component : resolve => require(['../pages/user/list.vue'],resolve),meta:{title:['会员管理','会员列表'],keepAlive:true}},
		{path:'/manage/user/apply',component : resolve => require(['../pages/user/apply.vue'],resolve),meta:{title:['会员管理','申请列表'],keepAlive:true}},
		{path:'/manage/user/list/detail/:id',component : resolve => require(['../pages/user/detail.vue'],resolve),meta:{title:['会员管理','会员列表','会员详情']}},
		{path:'/manage/user/setting',component : resolve => require(['../pages/user/setting.vue'],resolve),meta:{title:['会员管理','会员设置']}},
		{path:'/manage/setting/teaminfo',component : resolve => require(['../pages/setting/info.vue'],resolve),meta:{title:['系统设置','跑团信息']}},
		{path:'/manage/setting/password',component : resolve => require(['../pages/setting/password.vue'],resolve),meta:{title:['系统设置','修改密码']}},
		{path:'/manage/setting/teamcation',component : resolve => require(['../pages/setting/teamcation.vue'],resolve),meta:{title:['系统设置','跑团认证']}},
		{path:'/manage/setting/teamcation/process',component : resolve => require(['../pages/setting/cation/process.vue'],resolve),meta:{title:['系统设置','跑团认证','认证流程']}},
		{path:'/manage/setting/manage',component : resolve => require(['../pages/setting/manage.vue'],resolve),meta:{title:['系统设置','管理员管理']}},
		{path:'/manage/setting/notice',component : resolve => require(['../pages/setting/notice.vue'],resolve),meta:{title:['系统设置','跑团公告']}},
		{path:'/manage/message/setting',component : resolve => require(['../pages/message/setting.vue'],resolve),meta:{title:['短信管理','通知设置']}},
		{path:'/manage/message/send',component : resolve => require(['../pages/message/send.vue'],resolve),meta:{title:['短信管理','短信群发']}},
		{path:'/manage/message/account',component : resolve => require(['../pages/message/account.vue'],resolve),meta:{title:['短信管理','短信账户']}},
		{path:'/manage/team/list',component : resolve => require(['../pages/team/list.vue'],resolve),meta:{title:['关联跑团','关联跑团管理']}},
		{path:'/manage/team/setting',component : resolve => require(['../pages/team/setting.vue'],resolve),meta:{title:['关联跑团','关联设置']}},
		{path:'/manage/team/list/info/:id',component : resolve => require(['../pages/team/child-info.vue'],resolve),meta:{title:['关联跑团','关联跑团管理','跑团信息']}},
		{path:'/manage/active/list',component : resolve => require(['../pages/active/list.vue'],resolve),meta:{title:['活动管理','活动列表']}},
		{path:'/manage/active/add',component : resolve => require(['../pages/active/add-model.vue'],resolve),meta:{title:['活动管理','发布活动']}},
		{path:'/manage/active/add/:type',component : resolve => require(['../pages/active/add.vue'],resolve),meta:{title:['活动管理','发布活动']}},
		{path:'/manage/active/edit/:id',component : resolve => require(['../pages/active/edit.vue'],resolve),meta:{title:['活动管理','活动编辑']}},
		{path:'/manage/active/drafts',component : resolve => require(['../pages/active/drafts.vue'],resolve),meta:{title:['活动管理','草稿箱']}},
		{path:'/manage/active/list/edit',component : resolve => require(['../pages/active/edit-drafts.vue'],resolve),meta:{title:['活动管理','草稿箱','编辑草稿箱']}},
		{path:'/manage/finance/bank',component : resolve => require(['../pages/finance/bank.vue'],resolve),meta:{title:['财务管理','银行卡管理']}},
		{path:'/manage/finance/list',component : resolve => require(['../pages/finance/list.vue'],resolve),meta:{title:['财务管理','财务列表']}},
		{path:'/manage/finance/cash',component : resolve => require(['../pages/finance/cash.vue'],resolve),meta:{title:['财务管理','提现记录']}},
		{path:'*',redirect : '/manage/error/error'},
		{path:'/manage/error/error',component : resolve => require(['../pages/404/404.vue'],resolve)},
		{path:'/manage/login/index',component : resolve => require(['../pages/login/login.vue'],resolve)},
	],
	scrollBehavior (to, from, savedPosition) {
		return { x: 0, y: 0 };
	},
	mode: 'history',
})